package com.shop.domain.integral;

import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>User 实体类</p>
 * <p>Table: t_watch_videos_integral - 用户表</p>
 * @author generator
 * @date 2021-02-18 02:34:57
 */
@ApiModel("t_watch_videos_integral 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_watch_videos_integral")
@SQLDelete(sql = "update t_watch_videos_integral set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class WatchVideosIntegral extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	//@JSONField(serialize=false)
    private Long id;

    /**
	 * 当前用户所属总裁ID
	 */
    @ApiModelProperty("用户id")
	@Column(name = "uid")
    private Long uid;


    /**
     * 积分
     */
    @ApiModelProperty("积分")
    @Column(name = "integral")
    private BigDecimal integral;


    /**
     *说明
     */
    @ApiModelProperty("说明")
    @Column(name = "mark")
    private String mark;

    /**
     *广告ID
     */
    @ApiModelProperty("广告ID")
    @Column(name = "videos_id")
    private String videosId;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty("创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 最后一次更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty("最后一次更新时间")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
     * 是否删除 0：不删除   1：删除
     */
    @Column(name = "is_deleted")
    @ApiModelProperty("是否删除 0：不删除   1：删除")
    @JSONField(serialize=false)
    private Integer isDeleted;


}